<?php


public function qiandao()
{
    //2->10=2 //3->100=4 //4->1000=8 //5->10000=16
    $today=$_REQUEST['q'];
    $bintoday= pow(2,($today-1));
    $ma=M('member_auth')->where("id=3")->find();
    $todaybin=sprintf( "%08d", decbin($bintoday));
    $oldbin=sprintf( "%08d", decbin($ma["uid"]));
    $result = $todaybin | $oldbin;

    $hex =bindec($result);
    M('member_auth')->where("id=3")->save(["uid"=>$hex]);
    echo "签到成功";

}

public function getjilv()
{
    $ma=M('member_auth')->where("id=3")->find();
    $oldbin=sprintf( "%08d", decbin($ma["uid"]));
    $arr=str_split($oldbin, 1);
    krsort($arr);
    $count=count($arr);
    foreach ($arr as $key=>$v) {
        if($v==1){
            $list[]= ($count-$key)."号";
        }
    }
    echo "您签到的日期有:<br>";
    foreach ($list as $value) {
        echo $value."<br>";
    }

}